#ifndef WIN_EDITCTRLS_H
#define WIN_EDITCTRLS_H
#include "system.h"
#include "window.h"

namespace win
{
	using sys::Rect;
	
	// a control that allows the editing of text
	class TextControl : public ChildWindow
	{
		public:
			TextControl();
   			const char * GetText();
   			void Move(const int left, const int top, const int width);
			virtual ~TextControl();
			int DefaultHeight();
			int LineHeight(); // the height of a control with a single line
			virtual int NumLines();
			static void ResetFontHeight();
			virtual bool IsModified();
		private:
			static int s_defaultHeight;
			char* _buffer;
			void FreeBuffer();
		protected:
	};
	
	class EditBox : public TextControl
	{
		public:
			void Create(Window &parent, const int child_index, const Rect& pos);
   	};
	
	class MultiLineEdit : public TextControl
	{
		public:
			void Create(Window &parent, const int child_index);

	};

	
	class ComboBox : public TextControl
	{
		public:
			enum eBoxType {
				btSimple = CBS_SIMPLE,
				btDropDown = CBS_DROPDOWN,
				btDropDownList = CBS_DROPDOWNLIST
			};
					
		public:
			void Create(Window &parent, const int child_index,
   								const eBoxType type = btDropDownList );
   			// Add makes a copy of the char*
   			void Add(const char* string);
   			// Removes all Items from the combo box
   			void ResetContent();
   			void SelectString(const char * str);
			virtual bool IsModified();
			virtual int NumLines();
	};
	
	
}

#endif
